//询问事项
const state = {
    model: {
        SALESDETAIL_ID: '',
        CUSTOM_ID: '',
        CUSTOM: {},
        SALESDETAIL_ISINSURED: '',
        RELATIONPEOPLE_ID: '',
        SALESDETAIL_ISHOLDER: '',
        RELATIONPEOPLE_ID2: '',
        SALESDETAIL_ISBENEFICIARY: '',
        SALESDETAIL_APPLYTIME: '',
        PRODUCE_ID: '',
        PRODUCE_NAME: '',
        SALESDETAIL_ADDITION: '',
        SALESDETAIL_STARTTIME: '',
        SALESDETAIL_ENDTIME: '',
        SALESDETAIL_RANGE: '',
        SALESDETAIL_MONEY: '',
        SALESDETAIL_ADDMONEY: '',
        SALESDETAIL_ALLMONEY: '',
        SALESDETAIL_CONTENT: '',
        SALESDETAIL_PASSPORTDOC: '',
        SALESDETAIL_CODEDOC: '',
        SALESDETAIL_INSUREDDOC: '',
        SALESDETAIL_HOLDERDOC: '',
        SALESDETAIL_CONTACTDOC: '',
        SALESDETAIL_BENEFICIARYDOC: '',
        SALESDETAIL_TYPE: '',
        QUESTION_ID: '',
        SALESDETAIL_STATE: '',
        SALESDETAIL_DOC: '',
        SALESDETAIL_INSURANCEDOC: '',
        SALESDETAIL_INSURANCENUMBER: '',
        SALESDETAIL_CHECKSTATE: '',
        SALESDETAIL_SALESTIME: '',
        SALESDETAIL_OLD: '',
        QUESTION: {},
        RELATIONPEOPLEs: [],
        FAVOREEs: [],
        SALESDETAIL_CHECKMESSAGE: '', //审核意见
        SALESDETAIL_COMPANY: '',
        SALESDETAIL_PARTCOMPANY: '',
        SALESDETAIL_PRODUCEMONEY: '' //新增保额
    }
};
const mutations = {
    changer(state, result) {
        console.log("zhix")
            // 变更状态
        if (result.CUSTOM_ID) {
            state.model = result;
        } else {
            for (var p in state.model) {
                //必须先判断是否是数组                
                if (p == "FAVOREEs" || p == "RELATIONPEOPLEs") {
                    state.model[p] = [];
                } else if (p == "CUSTOM" || p == "QUESTION") {
                    state.model[p] = {};
                } else {
                    state.model[p] = '';
                }
            }
        }
    }
}

export default {
    state,
    mutations
    // mutations
}